/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Helper.TTAHelper;

import java.io.Serializable;

/**
 *
 * @author Lu Xiaodi
 */
public class Helper_DishSale implements Serializable, Comparable {

    private Long dishId;
    private String dishName;
    private Long sale;

    public Helper_DishSale() {
    }

    public Helper_DishSale(Long dishId, String dishName, Long sale) {
        this.dishId = dishId;
        this.dishName = dishName;
        this.sale = sale;
    }

    public Long getDishId() {
        return dishId;
    }

    public void setDishId(Long dishId) {
        this.dishId = dishId;
    }

    public String getDishName() {
        return dishName;
    }

    public void setDishName(String dishName) {
        this.dishName = dishName;
    }

    public Long getSale() {
        return sale;
    }

    public void setSale(Long sale) {
        this.sale = sale;
    }

    @Override
    public int compareTo(Object o) {
        if (!(o instanceof Helper_DishSale)) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
        else if (this.getSale()> ((Helper_DishSale)o).getSale()){
            return 1;
        } else if (this.getSale()< ((Helper_DishSale)o).getSale()){
            return -1;
        } else
            return 0;
    }
}
